<?php

namespace app\admin\model\validate;

use think\Validate;

class PaymentConfig extends Validate {
    protected $rule =   [
        'applet_app_id'  => 'require',
        'applet_name'  => 'require|max:24',
        'mch_id'  => 'require|number',
        'key'  => 'require|max:64',
        'app_id'  => 'require|max:32',
    ];

    protected $message  =   [
        'applet_app_id.require' => '小程序不能为空',
        'applet_name.require' => '小程序不能为空',
        'applet_name.max' => '小程序名不能超过24个字符',
        'mch_id.require' => '小程序绑定的商户ID不能为空',
        'mch_id.number' => '小程序绑定的商户是数字',
        'key.require' => '商户的KEY不能为空',
        'key.max'     => '商户的KEY不能超过64个字符',
        'app_id.require'     => '小程序的APP ID不能为空',
        'app_id.max'     => '小程序的APP ID不能超过32个字符',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
        'edit'  =>  ['applet_app_id','applet_name','mch_id', 'app_id'],
        'update_key' => ['key'],
    ];
}